<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ include file="../../Include/Config.jsp"%>
<html>
  <head>
    <title>Web Ram Program</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="ram/style.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="js/jquery-1.7.1.js"></script>
    <script type="text/javascript">
      $(function(){
      	<logic:messagesPresent message="true">
  	      <html:messages message="true" id="msg">
  	        var msgs = '<bean:write name="msg" />'; 
	            msgs = msgs.replace(/\?/g, '');
	            msgs = msgs.replace(/en_US./g, '');
	            msgs = msgs.replace(/ko_KR./g, '');
              if(msgs.search("성공") > 0){
              	alert(msgs);
                  location.href="system-img.do";
              }
  	      </html:messages>
        </logic:messagesPresent>

        $("img#insertImg").css("cursor","pointer").click(function(){
            var sysimgName = $("#sysimgName").val();
            if(sysimgName == "" || sysimgName == undefined){
                alert("이미지명을 입력해주세요.");
                $("#sysimgName").focus();
                return false;
            }
            var sysimgGubun = $("select[name=sysimgGubun]").val();
            if(sysimgGubun == "" || sysimgGubun == undefined){
                alert("구분을 선택해주세요.");
                $("input[name=sysimgGubun]").focus();
                return false;
            }            
            var upFile = $("#upFile").val();
            if(upFile == "" || upFile == undefined){
                alert("이미지파일을 선택해주세요.");
                $("#upFile").focus();
                return false;
            }

            if(confirm("저장 하시겠습니까?")){
                var form = $("form")[0];
                    form.submit();
            }
        });
      });    
    </script>
  </head>
  <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <html:form method="post" action="system-img-submit" enctype="multipart/form-data">
    <input type="hidden" name="method" value="insert">   
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr> 
              <td height="60">
                <!----- header ----------->
                <%@ include file="../../Include/Header.jsp"%>
                <!----- header end ----------->
              </td>
            </tr>
            <tr>
              <td>
                <div align="left">
                  <table width="1251" border="0" cellpadding="0" cellspacing="0">
                    <tr valign="top">
                      <td width="180" height="473">
                        <%@ include file="../../Include/Admin_Left.jsp"%>
                      </td>
                      <td width="20">&nbsp;</td>
                      <td>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td>
                              <!-----<table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td height="30" align="center" bgcolor="#333333"><font color="#FFFFFF"><strong>Project 등록</strong></font></td>
                                </tr>
                                <tr>
                                  <td height="1" bgcolor="f44901"></td>
                                </tr>
                                <tr>
                                  <td bgcolor="#f4f4f4">
                                    <table width="100%" border="0" cellspacing="0" cellpadding="10">
                                      <tr>
                                        <td valign="top">
                                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                              <td height="22">
                                                <p align="right">Home&gt;Admin&gt;System 이미지관리</p>
                                              </td>
                                            </tr>
                                          </table>
                                        </td>
                                      </tr>
                                    </table>
                                  </td>
                                </tr>
                              </table>--->
							  <img src="ram/images/sysimg-reg.jpg">
                            </td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                          <tr>
                            <td>
                              <table width="780" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <!------------------------------------------ 프로그램 적용 시작 -------------------------------->
                                  <td>
                                    <table width="1048" border="0" cellspacing="0" cellpadding="0">
                                      <tr>
                                        <td height="30" width="1048"><font color="ff3300"><b>기본정보</b></font></td>
                                      </tr>
                                      <tr>
                                        <td width="1048">
                                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                              <td bgcolor="#dddddd">
                                                <table width="100%" border="0" cellspacing="1" cellpadding="5" align="center">
                                                  <tr>
                                                    <td height="30" bgcolor="#f4f4f4" width="164">이미지명</td>
                                                    <td height="30" bgcolor="#ffffff" width="593">
                                                      <p>
                                                        <html:text styleId="sysimgName" property="sysimgName" styleClass="grayform" size="36"/>
                                                      </p>
                                                    </td>
                                                  </tr>
                                                  <tr>
                                                    <td width="164" height="30" bgcolor="#f4f4f4">구분</td>
                                                    <td width="593" height="30" bgcolor="white">
                                                      <p>
                                                        <html:select styleId="sysimgGubun" property="sysimgGubun">
                                                          <html:option value="B">Branch</html:option>
                                                          <html:option value="E">Equipment</html:option>
                                                        </html:select>
                                                      </p>
                                                    </td>
                                                  </tr>                                                                            
                                                  <tr>
                                                    <td height="30" bgcolor="#f4f4f4" width="164">이미지파일</td>
                                                    <td width="593" height="30" bgcolor="#FFFFFF">
                                                      <p>
                                                        <html:file styleId="upFile" property="upFile" styleClass="grayform" size="36" /> 
                                                      </p>
                                                    </td>
                                                  </tr>
                                                </table>
                                              </td>
                                            </tr>
                                          </table>
                                        </td>
                                      </tr>
                                      <tr>
                                        <td height="50" align="center" width="1048">
                                          <img id="insertImg" src="ram/images/btn_input.jpg" border="0">
                                        </td>
                                      </tr>
                                      <tr>
                                        <td width="1048">&nbsp;</td>
                                      </tr>
                                    </table>
                                  </td>
                                  <!------------------------------------------ 프로그램 적용 끝 -------------------------------->
                                </tr>
                              </table>
                            </td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                        </table>
                        <p>&nbsp;</p>
                      </td>
                    </tr>
                  </table>
                </div>
              </td>
            </tr>
            <tr>
              <td align="center"> 
                <%@ include file="../../Include/Foot.jsp"%>
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
  </html:form>
  </body>
</html>